{% extends "park/base.html" %}

{% block css %}
{% endblock %}

{% block content %}
    <script type="text/javascript">
    var primary_menu = "menu_4";
    var sub_menu = "menu_4_2";
    </script>
            <div class="col-md-12">
            <h3 class="company-name">{{en.name}}</h3>
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <div class="panel-title"><h3>其它特征化学污染物信息 </h3></div>
                        <!-- <a href="/pollution/other/chemicalAdd/" class="btn btn-success">添加</a> -->
                        <div class="panel-options">
                            <form role="form" action="" method="get" enctype="" class="form-horizontal pull-left">
                            
                            	<div class="form-group" style="margin-right: 10px;">
		                             <label class="control-label">特征化学污染名称：</label>
		                             <div>
		                             	<input  name="chemical_pollutants_name" class="time company" type="text" />
		                             </div>
		                         </div>
		                         
		                         <div class="form-group" style="margin-right: 10px;">
		                             <label class="control-label">排放量：</label>
		                             <div>
		                             	<input  name="emissions" class="time company" type="text" />
		                             </div>
		                         </div>
                            
	                            <div class="form-group" style="margin-right: 10px;">
		                             <label class="control-label">公司：</label>
		                             <div>
		                             	<input id='f_company' name="com" class="time company" type="text" />
		                             </div>
		                         </div>
		                         
		                         <div class="form-group" style="margin-right: 10px">
		                             <label class="control-label">排序：</label>
		                             <div>
		                             	<select name="orderby">
		                             		<option value="">--请选择--</option>
		                             		<option value="chemical_pollutants_name">特征化学污染名称</option>
		                             		<option value="com">公司名称</option>
		                             		<option value="emissions">排放量</option>
		                             	</select>
		                             </div>
		                         </div>
		                         
		                         
                                <div class="form-group filter-btn">
                                  <input type="submit" class="btn btn-success" value="筛选">
                                </div>
                            </form>
                            <!-- <a href="#" data-rel="collapse"><i class="entypo-down-open"></i></a> -->
                            <!--<a href="#" data-rel="reload"><i class="entypo-arrows-ccw"></i></a>-->
                        </div>
                        <!-- <div class="stay_right">
                            <a href="/pollution/other/chemicalAdd/" class="btn btn-success">添加</a>
                        </div> -->
                    </div>
                    <div class="panel-body with-table">
                        <table class="table table-bordered table-responsive">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>特征化学污染物名称</th>
                                <th>对应产品编号</th>
                                <th>产生工艺节点</th>
                                <th>排放介质</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for key in list%}
                            <tr>
                                <td>{{key.serial_number}}</td>
                                <td>{{key.chemical_pollutants_name}}</td>
                                <td>{{key.corresponding_product_number}}</td>
                                <td>{{key.produce_process_node}}</td>
                                <td>
                                	{%if key.medium_water%}
                                		水&nbsp;
                                	{%endif%}
                                	{%if key.medium_gas%}
                                		气&nbsp;
                                	{%endif%}
                                	{%if key.medium_solid%}
                                		固废&nbsp;
                                	{%endif%}
                                </td>
                                <td>
                                    <a href="/park/chemicalDetail/?id={{key.id}}" class="btn btn-success">查看</a>
                                </td>
                            </tr>
                            {%endfor%}
                            </tbody>
                        </table>
                        <div class="row">
                            <div class="col-xs-6 col-left">
                                <div class="dataTables_info" id="table-3_info"></div>
                            </div>
                            <div class="col-xs-6 col-right">
                                <div class="dataTables_paginate paging_bootstrap" style="text-align: right;margin-right: 10px">
                                    <ul class="pagination pagination-sm" >
                                        {% if cs.has_previous %}
                                            <li><a href="?page={{ cs.previous_page_number }}">上一页</a></li>
                                        {% else %}
                                            <li class="disabled"> <span>上一页</span></li>
                                        {% endif %}
                                        {% for p in paginator.page_range %}
                                            {% ifequal p cs.number %}
                                                <li class="active"> <span class="p">{{p}}</span></li>
                                            {% else%}
                                                <li> <a href="?page={{ p }}">{{p}}</a></li>
                                            {% endifequal %}
                                        {% endfor %}
                                        {% if cs.has_next %}
                                            <li class="next">  <a href="?page={{ cs.next_page_number }}">下一页</a></li>
                                        {% else %}
                                            <li class="disabled"><span>下一页</span></li>
                                        {% endif %}
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

{% endblock %}

{% block js %}
<script language="javascript">
			var ep_data = [
               {% for e in coms %}
                   { "id":{{ e.id }}, "value": "{{ e.name }}", "label": "{{ e.name }}" },
               {% endfor %}
           ];

           $(function () {
               $('#f_company').bind('click',function(){
                   $('#f_company')[0].setAttribute('eid', '');
                   console.log(123);
               })

               $('#f_company').autocompleter({ 
                   source: ep_data,
                   limit: 5,
                   callback: function (value, index) {
                       $('#f_company')[0].setAttribute('eid', ep_data[index].id);
                   }
               });
           });
</script>
    
{% endblock %}